package com.admin.common;

/**
 * <p>接口返回对象工具类</p>
 *
 * @Author: Hanson
 * @time 2019/8/9 20:20
 */
public class ResultUtil {

    public static Result success(Object object){
        Result result = new Result();
        result.setCode(200);
        result.setMsg("成功");
        result.setData(object);
        return result;
    }

    public static Result success(){
        return success(null);
    }

    public static Result error(Integer code, String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }

    public static Result error(String msg){
        return error(100, msg);
    }
}
